package com.eastshop.address.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.eastshop.address.dao.AddressDao;
import com.eastshop.address.vo.Address;

/**
 * 收货地址的Service类
 * @author admin
 *
 */
@Transactional
public class AddressService {
	// 注入AddressDao
	private AddressDao addressDao;

	public void setAddressDao(AddressDao addressDao) {
		this.addressDao = addressDao;
	}

	// Service层根据用户的id查询收货地址
	public List<Address> findByUid(Integer uid) {
		return addressDao.findByUid(uid);
	}

	// Service层保存收货地址的方法
	public void save(Address address) {
		addressDao.save(address);
	}
	
	// Service层根据收货地址id查找收货地址
	public Address findByAid(Integer aid) {
		return addressDao.findByAid(aid);
	}
	
	// Service层更新收货地址
	public void update(Address address) {
		addressDao.update(address);
	}

	// Service层删除收货地址
	public void delete(Address address) {
		addressDao.delete(address);
	}
	
}
